package com.bms.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * <p>初级/二级/三级的审核结果</p>
 * <p>角色与应用的桥表</p>
 * 
 * @author Lan
 */
@Entity
@Table(name = "T_AUDIT_RESULT")
public class AuditResult extends BaseEntity {

	private static final long serialVersionUID = 3653202168133776745L;

	// 桥表的附加属性
	private String auditRemark;// 对该应用进行本级审核时的 审核结果（未通过）备注，可反馈给前一级的审核员
	private Boolean isAuditOk;// 对该应用进行本级审核时的 审核状态。0-审核通过，1-审核未通过
	
	// 多对多关系
	private App app;//该应用可被多个审核员进行审核（三级审核）
	private Role role;//该审核员可审核多个应用

	public AuditResult() {
	}

	public AuditResult(App app, Role role) {
		this.app = app;
		this.role = role;
	}

	/**
	 * 审核不通过的备注
	 * @return
	 */
	@Column(length = 1000)
	public String getAuditRemark() {
		return auditRemark;
	}

	public void setAuditRemark(String auditRemark) {
		this.auditRemark = auditRemark;
	}

	/**
	 * 对该应用进行本级审核时的 审核状态。true-审核通过，false-审核未通过
	 * @author Lan
	 * @return
	 */
	@Column
	public Boolean getIsAuditOk() {
		return isAuditOk;
	}

	/**
	 * 对该应用进行本级审核时的 审核状态。true-审核通过，false-审核未通过
	 * @author Lan
	 * @param auditStatus 
	 */
	public void setIsAuditOk(Boolean isAuditOk) {
		this.isAuditOk = isAuditOk;
	}

	@ManyToOne
	@JoinColumn(name = "app_id")
	public App getApp() {
		return app;
	}

	public void setApp(App app) {
		this.app = app;
	}

	@ManyToOne
	@JoinColumn(name = "role_id")
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}
